<?php
	$token = $_POST['token'];
	$tid = htmlentities(trim($_POST['tid']));
	$tName = trim($_POST['tName']);
	if(!$token || !$tid){
		exit('parm is miss !');
	}
	require '../autoload.php';

	//token验证
	if(!token_v('tabTypeDel',$token)){
		exit('token is error !');
	}
	$mp = new MyPdo();
	$sql = "delete from translate_type where id = ?";
	$arr = array($tid);
	$res = $mp->dml($sql,$arr);
	if($res){
		$sql = "delete from translate_info where typeid = ?";
		$res = $mp->dml($sql,$arr);
		if($res){
			Clear_TableType();
			Clear_InfoAll();
			echo 'ok';
		}else{
			echo 'err';
		}
	}else{
		exit('err2');
	}

